package org.linlinjava.litemall.db.models;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.time.LocalDateTime;

@Getter
@Setter
@ToString
@EqualsAndHashCode(callSuper = false)
@TableName(value = "t_admin", autoResultMap = true)
public class Admin extends BaseModel{

    @TableField("username")
    private String username;

    @TableField("password")
    private String password;

    @TableField("last_login_ip")
    private String lastLoginIp;

    @TableField("last_login_time")
    private LocalDateTime lastLoginTime;

    @TableField("avatar")
    private String avatar;

    @TableField(value = "role_ids", typeHandler = JacksonTypeHandler.class)
    private Integer[] roleIds;

}